<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    //if
    let count = 3;
    if (count == 3) {
        alert(count);
    }
    // if else if
    let score = 85;

    if (score >= 90) {
        console.log("优秀");
    } else if (score >= 75) {
        console.log("良好");
    } else if (score >= 60) {
        console.log("及格");
    } else {
        console.log("不及格");
    }

    //switch
    let num = 3;
    switch (num) {
        case 1:
            alert("星期一");
            break;
        default:
            alert("输入的星期有误");
            break;
    }

    //for
    let num = 3;
    switch (num) {
        case 1:
            alert("星期一");
            break;
        default:
            alert("输入的星期有误");
            break;
    }

    //while
    let sum = 0;
    let i = 1;
    while (i <= 100) {
        sum += i;
        i++;
    }
    alert(sum);

    //do while
    let sum = 0;
    let i = 1;
    do {
        sum += i;
        i++;
    }while (i <= 100);
    alert(sum);



</script>
</body>
</html>